import request from '../utils/request.js'

export function createBooking(data) {
  return request({
    url: '/api/booking/create',
    method: 'POST',
    data
  })
}

export function getMyBookings() {
  return request({
    url: '/api/booking/list',
    method: 'GET'
  })
}

export function getCourtBookings(courtId, date) {
  return request({
    url: `/api/booking/court/${courtId}?date=${date}`,
    method: 'GET'
  })
}

export function cancelBooking(id) {
  return request({
    url: `/api/booking/cancel/${id}`,
    method: 'POST'
  })
}
